Ext.define('User',{
    extend: 'Ext.data.Model',
    fields:[
        {name: 'name',      type: 'string',  message: 'must be present.'},
        {name: 'age',       type: 'int', message: 'incorrect age.'},
        {name: 'phone',     type: 'string'},
        {name: 'gender',    type: 'string'},
        {name: 'username',  type: 'string'},
        {name: 'alive',     type: 'boolean', defaultValue: true}
    ],
    
     validations: [
        {type: 'presence',  field: 'age' },
        {type: 'length',    field: 'name',      min: 2},
        {type: 'inclusion', field: 'gender',    list: ['Male', 'Female']},
        {type: 'exclusion', field: 'username',  list: ['Admin', 'Operator']},
        {type: 'format',    field: 'username',  matcher: /([a-z]+)[0-9]{2,3}/}
    ]
});

